gh-118965: Share NotImplemented in subinterpreters - #118966
Conversation
|
cpython/Lib/test/test_interpreters/test_api.py Lines 1128 to 1130 in 176b42a Should be moved to cpython/Lib/test/test_interpreters/test_api.py Lines 1099 to 1101 in 176b42a By the way, is there a reason |
|
@nineteendo thanks.
I don't think so. I plan to address it in the next PR. |
|
FWIW, there's no urgency here. The other singletons have a clear value in being shareable. However, |
| // NotImplemented | ||
| if (_xidregistry_add_type(xidregistry, | ||
| (PyTypeObject *)PyObject_Type(Py_NotImplemented), | ||
| _notimplemented_shared) != 0) { | ||
| Py_FatalError("could not register NotImplemented for cross-interpreter sharing"); | ||
| } |
There was a problem hiding this comment.
Should we generalize this with a macro? (Future refactoring)
There was a problem hiding this comment.
I don't think so. Last I heard, Eric's plan was to eventually get a dedicated type slot for crossinterpreter registry things, so this will (hopefully) be obsolete sooner than later.
ZeroIntensity
left a comment
There was a problem hiding this comment.
Trying to work through the subinterpreter backlog a bit :)
| // NotImplemented | ||
| if (_xidregistry_add_type(xidregistry, | ||
| (PyTypeObject *)PyObject_Type(Py_NotImplemented), | ||
| _notimplemented_shared) != 0) { | ||
| Py_FatalError("could not register NotImplemented for cross-interpreter sharing"); | ||
| } |
There was a problem hiding this comment.
I don't think so. Last I heard, Eric's plan was to eventually get a dedicated type slot for crossinterpreter registry things, so this will (hopefully) be obsolete sooner than later.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
Merging from main seemed to blow up CI. I think something changed with XI registries after this was created. |
|
This PR is stale because it has been open for 30 days with no activity. |
I still use
Py_NewRefdespite the fact thatNotImplementedis immortal:NotImplementedsingletons in subinterpreters #118965